/* ThemeSwitch.css */
:root {
  --transition-time: 500ms;
}

.app {
  position: relative;
  min-height: 100vh;
}

.content {
  padding: 20px;
  transition: background-color var(--transition-time), color var(--transition-time);
}

/* 白天模式变量 */
[data-theme='light'] {
  --bg-color: #ffffff;
  --text-color: #303133;
  --primary-color: #409eff;
  --border-color: #dcdfe6;
}

/* 黑夜模式变量 */
[data-theme='dark'] {
  --bg-color: #1f1f1f;
  --text-color: #ebeef5;
  --primary-color: #409eff;
  --border-color: #444444;
}

body {
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color var(--transition-time), color var(--transition-time);
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--primary-color);
  cursor: pointer;
  z-index: 1000;
  transition: all var(--transition-time);
}

.theme-transition-mask {
  position: fixed;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  border-radius: 50%;
  transform: scale(0);
  background-color: var(--primary-color);
  z-index: 999;
  animation: theme-transition var(--transition-time) ease-out forwards;
  pointer-events: none;
}

@keyframes theme-transition {
  0% {
    transform: scale(0);
    border-radius: 50%;
    opacity: 0.8;
  }
  70% {
    transform: scale(2.5);
    border-radius: 50%;
    opacity: 0.3;
  }
  100% {
    transform: scale(5);
    border-radius: 50%;
    opacity: 0;
  }
}
/* 修改后的 ThemeSwitch.css 关键部分 */
.theme-transition-mask {
  position: fixed;
  top: 0;
  right: 0; /* 固定在右上角 */
  width: 100vmax; /* 使用视口最大尺寸确保覆盖 */
  height: 100vmax;
  background-color: var(--primary-color);
  z-index: 999;
  transform-origin: 100% 0%; /* 关键：设置变换原点为右上角 */
  animation: theme-transition var(--transition-time) ease-out forwards;
  pointer-events: none;
}

@keyframes theme-transition {
  0% {
    transform: scale(0); /* 初始缩放为0 */
    border-radius: 50%;
    opacity: 0.8;
  }
  70% {
    transform: scale(1); /* 放大到刚好覆盖屏幕 */
    border-radius: 50%;
    opacity: 0.3;
  }
  100% {
    transform: scale(1.2); /* 略微放大确保覆盖边缘 */
    border-radius: 50%;
    opacity: 0;
  }
}

/* 可选优化：限制最大尺寸避免过大 */
@media (min-width: 1920px) {
  .theme-transition-mask {
    width: 2500px;
    height: 2500px;
  }
}